package com.hp.snap.gr.model;

/**
 * To indicates a session server is alive and providing service, the process status must be 'RUNNING',
 * and the kernel status should be 'ACTIVE', and the business service status should be 'Running';
 * <p/>
 * To indicates a session server is alive and standby for service providing, the process status must be 'RUNNING',
 * and the kernel status should be 'ACTIVE', and the business service status should be 'Standby';
 */
public class SessionServerStatus {
    /**
     * Session server name
     */
    private final String name;

    /**
     * The session server process status
     */
    private final ProcessStatus processStatus;

    /**
     * The virgo kernel status
     */
    private final KernelStatus kernelStatus;

    /**
     * The business service status
     */
    private final BizServiceStatus bizServiceStatus;

    public SessionServerStatus(String name, ProcessStatus processStatus, KernelStatus kernelStatus, BizServiceStatus bizServiceStatus) {
        this.name = name;
        this.processStatus = processStatus;
        this.kernelStatus = kernelStatus;
        this.bizServiceStatus = bizServiceStatus;
    }

    public String getName() {
        return name;
    }

    public ProcessStatus getProcessStatus() {
        return processStatus;
    }

    public KernelStatus getKernelStatus() {
        return kernelStatus;
    }

    public BizServiceStatus getBizServiceStatus() {
        return bizServiceStatus;
    }

    public enum ProcessStatus {
        STOPPED,
        RUNNING
    }

    public enum KernelStatus {
        IDLE,
        STARTING,
        ACTIVE,
        STOPPING
    }
}
